<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DonReY Framework :: Modules</title>
<link rel='stylesheet' type='text/css' href='/Documentation/DonReY.css' media='screen' />
</head>
<body>
<a href="/documentation/donrey.html" title="DonReY Framework Documentation">DonReY Framework Documentation</a> &raquo; <a href="/documentation/structure.html" title="Framework structure">Framework structure</a> &raquo; Modules
<hr />
	<h2>Modules &#8211; Providing functionality to the DonReY Framework</h2>

	<p>DonReY Modules are <span class="caps">PHP</span> classes which are loaded and instanced by the <a href="structure/core.html">Core</a> only when they are needed.<br />
While some modules can be used individually, others depend on other modules to implement their functionality. For example, the News module needs a database to store it&#8217;s content.</p>

	<p>Using a module in DonReY is very simple (Using <strong>test</strong> module as example):</p>

	<p><strong>Step 1:</strong> Make sure the module&#8217;s configuration is present in the Project Configuration file (<em>project-config.xml</em>):</p>

<pre class="xml"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">?&gt;</span></span>
<span class="sc3"><span class="re1">&lt;config<span class="re2">&gt;</span></span></span>
	<span class="sc3"><span class="re1">&lt;core<span class="re2">&gt;</span></span></span>
		<span class="sc3"><span class="re1">&lt;modules<span class="re2">&gt;</span></span></span>
			<span class="sc-1">&lt;!-- Allow using the &quot;test&quot; module --&gt;</span>
			<span class="sc3"><span class="re1">&lt;test</span> <span class="re2">/&gt;</span></span>
		<span class="sc3"><span class="re1">&lt;/modules<span class="re2">&gt;</span></span></span>
	<span class="sc3"><span class="re1">&lt;/core<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/config<span class="re2">&gt;</span></span></span>
</pre>

	<p><strong>Step 2:</strong> Use it !</p>

<pre class="php"><span class="sy0"></span>	<span class="co1">// Attempt to use the module which appears under the name or alias &quot;test&quot; in configuration	</span>
	<span class="re0">$test_module</span> <span class="sy0">=</span> core<span class="sy0">::</span><span class="me2">test</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// That's it ! Core takes care of loading, instancing, configuring</span>
&nbsp;
	<span class="co1">// ... then call some module method:</span>
	<span class="re0">$test_module</span><span class="sy0">-&gt;</span> <span class="me1">do_Something</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="sy0"></span></pre>

	<h3>List of built-in modules</h3>

	<ul>
		<li><a href="modules/application.html">Application</a> &#8211; Application organizer and &#8220;Controller&#8221; manager in an <span class="caps">MVC</span> pattern</li>
		<li><a href="modules/authentication.html">Authentication</a> &#8211; User authentication system</li>
		<li><a href="modules/cmsmatrix.html"><span class="caps">CMS</span> Matrix</a> &#8211; Fully flexible and programable <span class="caps">CMS</span> system</li>
		<li><a href="modules/database.html">Database</a> &#8211; Database access module, this is the lowest level module for database access, it represents the DB connection</li>
		<li><a href="modules/debug.html">Debug</a> &#8211; Advanced debugger module</li>
		<li><a href="modules/layout.html">Layout</a> &#8211; Layout module &#8211; &#8220;View&#8221; manager in an <span class="caps">MVC</span> pattern &#8211; Pull mode</li>
		<li><a href="modules/news.html">News</a> &#8211; News/Blog like <span class="caps">CMS</span></li>
		<li><a href="modules/persistence.html">Persistence</a> &#8211; Data Persistence module (data survives between script runs)</li>
		<li><a href="modules/queryfactory.html">Query Factory</a> &#8211; <span class="caps">SQL</span> Query Building system</li>
		<li><a href="modules/record.html">Record</a> &#8211; Object Relational Mapping system &#8211; Records and RecordSets</li>
		<li><a href="modules/render.html">Render</a> &#8211; Render module &#8211; Combines various sources of data to produce a stringified output &#8211; can be used as &#8220;View&#8221; manager in an <span class="caps">MVC</span> pattern &#8211; Push mode</li>
		<li><a href="modules/structure.html">Structure</a> &#8211; Data organization mechanism ( for databases )</li>
		<li><a href="modules/test.html">Test</a> &#8211; <span class="caps">TEST</span> Module (Used for tutorials)</li>
		<li><a href="modules/translate.html">Translate</a> &#8211; Translation (Multilanguage) module</li>
	</ul>
</body>
</html>
<!-- http://www.donrey.net/Documentation - Built with DonReY Framework http://www.donrey.net/ - Powered by PHP, MySQL, JavaScript -->